/*
 * Copyright 2003-2005 (c) Live Media Pty Ltd. <argot@einet.com.au> 
 *
 * This software is licensed under the Argot Public License 
 * which may be found in the file LICENSE distributed 
 * with this software.
 *
 * More information about this license can be found at
 * http://www.einet.com.au/License
 * 
 * The Developer of this software is Live Media Pty Ltd,
 * PO Box 4591, Melbourne 3001, Australia.  The license is subject 
 * to the law of Victoria, Australia, and subject to exclusive 
 * jurisdiction of the Victorian courts.
 */
 
#ifndef REFERENCETYPEMAP
#define REFERENCETYPEMAP

#ifdef __cplusplus
extern "C" {
#endif

struct reference_type_map_vtable
{
    int (*map)( type_map * map, int id, int systemid );
    int   (*get_id)( type_map * map, type_name * name );
	type_name * (*get_name)( type_map * map, int id );
    typeReader (*get_reader)( type_map * map, int id );
    typeWriter (*get_writer)( type_map * map, int id );
    type_element * (*get_structure)( type_map * map, int id );
    int (*get_library_id)( type_map * map, int id );
    int (*get_mapped_id)( type_map * map, int systemId );
    bool (*is_valid_id)( type_map * map, int id );
    bool (*is_valid_name)( type_map * map, type_name * name );    
}; 

typedef struct reference_type_map
{
	type_map map;
	type_map * reference;	
}
reference_type_map;

void reference_type_map_init( reference_type_map * map, type_library * library, type_map * reference );

type_map * reference_type_map_get_reference( reference_type_map * map );

void reference_type_map_set_reference( reference_type_map * map, type_map * ref );

#ifdef __cplusplus
}
#endif


#endif
